package com.aabte.testng;

import org.testng.annotations.Test;

/**
 * 依赖测试
 */
public class DependTest {

    @Test
    public void test1(){
        System.out.println("run test1");
        // test2方法依赖test1方法，抛出异常test1方法失败，test2方法将被忽略
        throw new RuntimeException();
    }

    /**
     * test2方法依赖test1方法
     */
    @Test(dependsOnMethods = {"test1"})
    public void test2(){
        System.out.println("run test2");
    }

}
